<?php
namespace Modules\Frontend\Controllers;

class SystemParameterController extends \Phalcon\Mvc\Controller {
	public function beforeExecuteRoute() {
		\Components\Utils::isClosedFrontent($this);
	}

	public function initialize() {
		$this -> response -> setStatusCode(200, 'OK') -> sendHeaders() -> setContentType('application/json', 'UTF-8');
	}

	public function findFirstByACCOUNT_BACKSTAGE_BANK_INFOAction() {
		$service = $this -> parameter::getServiceInstance() -> findFirstByKey('ACCOUNT_BACKSTAGE_BANK_INFO');
		if($service['code'] != 0) {
			return $this -> response -> setJsonContent(['code'=>-1,'msg'=>'数据不存在!']);
		}

		$model = $service['model'] -> toArray();
		$model['value'] = json_decode($model['value'], true);
		return $this -> response -> setJsonContent(['code'=>0,'msg'=>'Success', 'model' => $model]);
	}
}